package ee.ttu.rakarh.commands;

import java.util.Collection;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;

import ee.ttu.rakarh.model.data.dao.PriceListDAO;
import ee.ttu.rakarh.model.data.dao.PriceListDAOImpl;
import ee.ttu.rakarh.model.data.entities.PriceList;

public class GetPriceLists implements Command {
	public static final Logger LOG = Logger.getLogger(GetPriceLists.class);
	@Override
	public Boolean execute(HttpServletRequest request,
			HttpServletResponse response) {
		LOG.info("prepearing price list");
		PriceListDAO priceListDAO = new PriceListDAOImpl();
		Collection<PriceList> priceLists = priceListDAO.getAllPriceLists();
		request.setAttribute("priceLists", priceLists);
		return true;
	}

}
